import wxp from 'minapp-api-promise'

export function fade (opacity, duration) {
  let animation = wxp.createAnimation({
    duration: duration,
    timingFunction: 'ease'
  })
  animation.opacity(opacity).step()
  return animation.export()
}

export function side (t) {
  let animation = wxp.createAnimation({
    duration: 200,
    timingFunction: 'ease'
  })
  animation.translateY(t).step()
  return animation.export()
}
